OU-1472: run only changed tests - #1134
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@PeterYurkovich: This pull request references OU-1472 which is a valid jira issue. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: PeterYurkovich The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
4e1102d to
3335c07
Compare
3335c07 to
217d32c
Compare
| @@ -0,0 +1,62 @@ | |||
| #!/bin/bash | |||
|
|
|||
| CHANGED_FILES=$(git diff --name-only origin/main...HEAD) | |||
There was a problem hiding this comment.
The target branch might be different we should provide it from env defaulting to main
There was a problem hiding this comment.
we should add error handling, in shallow checkouts the main branch might not exist.
| "test-cypress-perses-dev": "node --max-old-space-size=4096 ./node_modules/.bin/cypress run --browser chrome --headless --env grepTags='@perses-dashboards --@xfail'", | ||
| "test-cypress-perses": "node --max-old-space-size=4096 ./node_modules/.bin/cypress run --browser chrome --headless --env grepTags='@perses-dashboards --@smoke --@flaky --@xfail'", | ||
| "test-cypress-perses-ivt": "node --max-old-space-size=4096 ./node_modules/.bin/cypress run --browser chrome --headless --env grepTags='@perses-dashboards --@smoke --@flaky --@xfail'", | ||
| "test-cypress-monitoring": "../scripts/run-selective-e2e.sh", |
There was a problem hiding this comment.
Is this script in a different PR or should be ./cypress/run-changed.sh
| if [ "$RUN_ALL" = true ]; then | ||
| echo "Changes affect global scope or unmapped features. Running ALL monitoring tests..." | ||
|
|
||
| DEFAULT_TAGS="@alerting @legacy-dashboards @metrics @targets acm-alerting @cluster-health-analyzer @perses-dashboards --@flaky --@xfail" |
There was a problem hiding this comment.
| DEFAULT_TAGS="@alerting @legacy-dashboards @metrics @targets acm-alerting @cluster-health-analyzer @perses-dashboards --@flaky --@xfail" | |
| DEFAULT_TAGS="@alerting @legacy-dashboards @metrics @targets @acm-alerting @cluster-health-analyzer @perses-dashboards --@flaky --@xfail" |
| "test": "npm run cypress:run:ci", | ||
| "test-cypress-console": "./node_modules/.bin/cypress open --browser chrome", | ||
| "test-cypress-console-headless": "node --max-old-space-size=4096 ./node_modules/.bin/cypress run --browser chrome --headless", | ||
| "test-cypress-monitoring": "node --max-old-space-size=4096 ./node_modules/.bin/cypress run --browser chrome --headless --env grepTags='@alerting+@legacy-dashboards+@metrics+@targets --@flaky --@xfail'", |
There was a problem hiding this comment.
Do we need to update the cypress docs with these removals?
| CHANGED_FILES=$(git diff --name-only origin/main...HEAD) | ||
|
|
||
| RUN_ALL=false | ||
| declare -A TAGS_TO_RUN |
There was a problem hiding this comment.
We might need to change this into something POSIX compatible, I got the following issue while trying to run on mac:
./cypress/run-changed.sh: line 6: declare: -A: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
| done | ||
|
|
||
| if [ "$RUN_ALL" = true ]; then | ||
| echo "Changes affect global scope or unmapped features. Running ALL monitoring tests..." |
There was a problem hiding this comment.
unmapped features already exits
| echo "Changes affect global scope or unmapped features. Running ALL monitoring tests..." | |
| echo "Changes affect global scope. Running ALL monitoring tests..." |
| FEATURE_MAP["perses-dashboards"]="@perses-dashboards" | ||
| FEATURE_MAP["targets"]="@targets" | ||
|
|
||
| for FILE in $CHANGED_FILES; do |
There was a problem hiding this comment.
not sure if we have file paths with white spaces, but this will split on white space
2c3cc81 to
88ad602
Compare
88ad602 to
49d7ac8
Compare
489aca6 to
3ce7387
Compare
3b1dbb7 to
6e7f913
Compare
8c07d23 to
b9236d2
Compare
b9236d2 to
f3bd9eb
Compare
f3bd9eb to
dd928b5
Compare
42970ca to
8ef35ed
Compare
300c476 to
f0cac24
Compare
f0cac24 to
5fbeb01
Compare
5fbeb01 to
9bbf6e1
Compare
9bbf6e1 to
a44cc93
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (5)
Included review availability: Your plan provides up to 12 included reviews per hour; 8 remain after this review. WalkthroughThe pull request adds changed-file-based Cypress monitoring selection, preserves the base Cypress command, updates command documentation, replaces obsolete quick commands, and fixes one Cypress support import path. ChangesCypress monitoring execution
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change introduces selective Cypress monitoring execution while retaining the base test command. No current merge-blocking risk is identified. Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant Git
participant run-changed.sh
participant npm
participant Cypress
Git->>run-changed.sh: Detect changed files
run-changed.sh->>run-changed.sh: Map changes to Cypress tags
run-changed.sh->>npm: Invoke monitoring test command
npm->>Cypress: Run selected tagged tests
🚥 Pre-merge checks | ✅ 14 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (14 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (3 skipped: 3 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
Stack created with GitHub Stacks CLI • Give Feedback 💬
Summary by CodeRabbit
New Features
Documentation
Bug Fixes